package cn.spcloud.jms.service;

import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSON;

import cn.spcloud.core.entity.User;

/**
 * 接收消息并处理
 * 
 * @author Administrator
 *
 */
@Service
public class JmsService {

	/**
	 * 监听消息
	 * 
	 * @param msg
	 */
	@JmsListener(destination = "user_reg")
	public void userReg(String msg) {
		User user = JSON.parseObject(msg, User.class);
		System.out.println("接收到消息:" + msg);
		System.out.println(user);
	}
}
